/*********************************************************************
 *
 *  elksip - a multi-platform Sip Phone Server
 *
 *  file: nonce_test.c
 *
 *  Copyright 2011-2014 Elksip.
 *
 ********************************************************************/


#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>

#include "elk_nonce.h"


int main(int argc, char* argv[])
{
    elk_init_nonce();
    char nonce[32];
    char nonce2[32];
    int ret = elk_nonce(NULL, nonce);
    ret = elk_nonce_verify(NULL, nonce);
    if(ret==0)
    {
        printf("nonce pass\n");	
    }else
    {
    	  printf("nonce error  unit test failed\n");
       return -1;
    }

    strcpy(nonce2, nonce);
     elk_nonce_verify(NULL, nonce2);
    if(ret==0)
    {
        printf("nonce2 pass\n");	
    }else
    {
    	  printf("nonce2  error  unit test failed\n");
       return -2;
    }
    
    return 0;
}

